{extend name="public/base"/}
{block name="style"}
<script type="text/javascript" src="/public/lboyue/m/sitejs/book.js?v=20181123"></script>
<script type="text/javascript">

    $(document).ready(function () {


        $('.moreIco').click(function () {

            if($(this).hasClass('closeIco')){

                $('#header').removeClass('app_headerFixed2');
                $(this).removeClass('closeIco');
                $('.app_header_second').hide();
                $('.app_meskSection').hide();

            }else{

                $('#header').addClass('app_headerFixed2');
                $(this).addClass('closeIco');
                $('.app_header_second').show();
                $('.app_meskSection').show();
            }



        })

        $('body').on('click','.app_meskSection',function () {
            $('.app_header_second').hide();
            $('.app_meskSection').hide();
            $('#header').removeClass('app_headerFixed2');
            $('.moreIco').removeClass('closeIco');
        })
    })
</script>
<style>

.app_borderBlock .icon-hot {
    position: absolute;
    top: -20px;
    right: -8px;
	z-index:999;
    width: 26px;
    height: 44px;
    object-fit: contain;
}
</style>
{/block}
{block name="body"}
<div class="app_goBackToTop"></div>
<div class="app_meskSection"></div>

<div class="container">

    <div class="app_header_section2  app_scrollerHeader" id="header">
        <div class="app_header_detail2">
            <div class="app_header_back" ></div>
            <div class="app_header_h1">
                充值                <a href="/personal/bookcase"> <i class="shujiaIco"></i></a>
                <i class="moreIco"></i>
            </div>
        </div>
		{include file="public/dropnav" /}
		    </div>



    <div class="app_body">
        
        <div class="app_syMoney">
        <ul>
            <li>账户余额：{$user.egold}{:config('virtualname')}</li>
            <li>VIP截止时间：{if $user.is_vip>0}{if $user.vip_enddate>=time()}还剩<font size="" color="#ff3300">{php} echo round(($user.vip_enddate-time())/86400);{/php}</font>天过期{else/}已过期{/if}{else/}未开通{/if}</li>
        </ul>
    </div>


    <div class="app_openReadBlock">

        <div class="app_openReadBlock_li  app_deleteMargin">


                        <div class="app_tabSection app_tabSection2">

                <div class="app_tabSection_border">
                    <ul>
                        <li class="active"><i>微信</i></li>

                        <li><i>支付宝</i></li>

                    </ul>
                </div>

            </div>
            

            <div class="app_selectBlock">

                <div class="app_list">
                    <div class="app_openReadBlock_select">
                        <ul>

				{empty name="paysetting"}
					{notempty name="diy_product"}
						{volist name="diy_product" id="vo"}
						<li  {if $vo.default ==1}class="active"{/if} data-type='{$vo.type}' data-paymoney='{$vo.price|floatval}' data-payitem='{$vo.egold}' data-activityid='0' data-payid='{$vo.payid}' data-userlimit='{$vo.user_limit}'>
							<div class="app_borderBlock">
							   <span class="top">
									<span class="number">
										<i>{$vo.price|floatval}元{if $vo.user_limit>0}(限充{$vo.user_limit}次){/if}</i>
										<i>{$vo.egold}{:config('virtualname')}</i>
									</span>
							    </span>
								<span class="bottom">多送{$vo.giveegold}{:config('virtualname')}</span>
							</div>
						</li>
						{/volist}
					{/notempty}
					{notempty name="custom_product"}
						{volist name="custom_product" id="vo"}
						<li data-type='{$vo.type}' data-paymoney='{$vo.price|floatval}' data-payitem='{$vo.egold}' data-activityid='{$vo.activityid}' data-payid='{$vo.payid}' data-userlimit='0'>
							<div class="app_borderBlock">
							   <span class="top">
									<span class="number">
										<i>{$vo.price|floatval}元{if $vo.user_limit>0}(限充{$vo.user_limit}次){/if}</i>
										<i>{$vo.egold}{:config('virtualname')}</i>
									</span>
							    </span>
								<span class="bottom">多送{$vo.giveegold}{:config('virtualname')}</span>
								<img class="icon-hot" src="/public/images/icon_sale.png">
							</div>
						</li>
						{/volist}
					{/notempty}

					{notempty name="platform_product"}
						{volist name="platform_product" id="vo"}
						<li data-type='{$vo.type}' data-paymoney='{$vo.price|floatval}' data-payitem='{$vo.egold}' data-activityid='{$vo.activityid}' data-payid='{$vo.payid}' data-userlimit='0'>
							<div class="app_borderBlock">
							   <span class="top">
										<span class="number">
										<i>{$vo.price|floatval}元{if $vo.user_limit>0}(限充{$vo.user_limit}次){/if}</i>
										<i>{$vo.egold}{:config('virtualname')}</i>
									</span>
									<!---
									<img class="icon-hot" src="/public/images/icon_sale.png">--->
							    </span>
								<span class="bottom">多送{$vo.giveegold}{:config('virtualname')}</span>
							</div>
						</li>
						{/volist}
					{/notempty}
					{notempty name="vip_product"}
						{volist name="vip_product" id="vo"}
						<li data-type='{$vo.type}' data-paymoney='{$vo.price|floatval}' data-payitem='{$vo.egold}' data-activityid='0' data-payid='{$vo.id}' data-userlimit='0'>
							<div class="app_borderBlock">
							   <span class="top">
										<span class="number">
										<i>{$vo.price|floatval}元</i>
										<i>{if $vo.type==2}VIP会员{else /}{$vo.egold}{:config('virtualname')}{/if}</i>
									</span>
							    </span>
								<span class="bottom">{if $vo.type==1}多送{$vo.giveegold}{:config('virtualname')}{else /}{$vo.description}{/if}</span>
							</div>
						</li>
						{/volist}
					{/notempty}
				{else /}
                {volist name="paysetting" id="vo"}                                 <li  {if $type && $vo.price ==$type}class="active"{/if}{if empty($type)&&$i==1}class="active"{/if} data-type='{$vo.type}' data-paymoney='{$vo.price|floatval}' data-payitem='{$vo.egold}' data-activityid='0' data-payid='{$vo.id}' data-userlimit='0'>
						<div class="app_borderBlock">
						   <span class="top">
								<span class="number">
									<i>{$vo.price|floatval}元</i>
																									<i>{if $vo.type==2}VIP会员{else /}{$vo.egold}{:config('virtualname')}{/if}</i>
																								</span>
						   </span>
							<span class="bottom">{if $vo.type==1}多送{$vo.giveegold}{:config('virtualname')}{else /}{$vo.description}{/if}</span>
						</div>
					</li>
					{/volist}
				{/empty}
                        </ul>
                    </div>
                </div>
            </div>

            <a class="app_openReadBlock_button" id="paybtn">立即充值</a>

        </div>



        <div class="app_friendTips">
            <span class="tips">温馨提示</span>
                 <span class="cons">
                      1.批量购买章节是付费章节，如期间有免费章节和已购买章节，下载时将一并下载。<br/>
                      2.免费章节及已购买章节不会重复扣费，请放心购买。<br/>
                      3.{:config('virtualname')}属于虚拟货币，一旦充值不得退还</p>
					  4.充值后{:config('virtualname')}到账可能有延迟，1小时内未到账请联系{notempty name="cfgqq"}客服QQ：{$cfgqq}，{/notempty}{notempty name="cfgwechat"}客服微信：{$cfgwechat}，{/notempty}或拨打客服电话:{$cfgtel}</p>
					 <p>*工作时间：周一到周五 9：00-18：00</p>
                 </span>
        </div>
    </div>
        
	{block name="include"}{include file="public:footer" /}{/block}

       
    </div>
</div>

{/block}
{block name="script"}
  <script type="text/javascript" src="/public/lboyue/m/sitejs/user.js"></script>
    <script type="text/javascript">

        var reurl='';
        var paytype=1;
        var type=1;
        var payurl = "{$payurl}";
		var pay_change = {$pay_change};
		var activityid = 0;
		var payid = 0;
		var userlimit = 0;
		var ua = navigator.userAgent.toLowerCase();
        $(document).ready(function () {
			var egold=$('.app_openReadBlock_select li.active').data('paymoney');

            $('.app_openReadBlock_select li').click(function () {
                $(this).parent().find('li').removeClass('active');
                $(this).addClass('active');
                var activeIndex = $(this).index();
                type= $(this).attr('data-type');
				egold= $(this).attr('data-paymoney');
				activityid = $(this).attr('data-activityid');
				payid = $(this).attr('data-payid');
				userlimit = $(this).attr('data-userlimit');
            })

           
            $('#paybtn').click(function () {
				
				if (paytype==2)
				{
					document.location.href=payurl+'/alipay/pay.html?egold='+egold+'&type='+type+'&activityid='+activityid+'&payid='+payid+'&userlimit='+userlimit;
				}else{
					if(ua.match(/MicroMessenger/i)=="micromessenger") {
						if (pay_change==1)
						{
							document.location.href=payurl+'/pay/pay.html?egold='+egold+'&type='+type+'&activityid='+activityid+'&payid='+payid+'&userlimit='+userlimit;
						}else{
							document.location.href=payurl+'/pay/thirdpay.html?egold='+egold+'&type='+type+'&activityid='+activityid+'&payid='+payid+'&userlimit='+userlimit;
						}
						
					} else { 
						document.location.href=payurl+'/alipay/pay.html?egold='+egold+'&type='+type+'&activityid='+activityid+'&payid='+payid+'&userlimit='+userlimit;
					}
				}
            })


            //tab切换
            $('.app_tabSection').on('click','li', function () {

                $(this).parent().find('li').removeClass('active');
                $(this).addClass('active');

                var activeIndex = $(this).index();
               if(activeIndex==0)
               {
                   paytype=1;
               }else if (activeIndex==1)
               {
                   paytype=2;
               }

            })

			$('.app_header_back').on('click', function () {
				if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)){ // IE
					if(history.length > 0){
						window.history.go( -1 );
					}else{
						window.location.href = "/";
					}
				}else{ //非IE浏览器
					if (navigator.userAgent.indexOf('Firefox') >= 0 ||
						navigator.userAgent.indexOf('Opera') >= 0 ||
						navigator.userAgent.indexOf('Safari') >= 0 ||
						navigator.userAgent.indexOf('Chrome') >= 0 ||
						navigator.userAgent.indexOf('WebKit') >= 0){
			 
						if(window.history.length > 1){
							window.history.go( -1 );
						}else{
							window.location.href = "/";
						}
					}else{ //未知的浏览器
						window.history.go( -1 );
					}
				}
			})
        })
		
		function goBack(){
			console.log(navigator.userAgent.indexOf('Chrome'));
			console.log(window.history.length);
			/**
			if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)){ // IE
				if(history.length > 0){
					window.history.back(-1);
				}else{
					window.location.href = "/";
				}
			}else{ //非IE浏览器
				if (navigator.userAgent.indexOf('Firefox') >= 0 ||
					navigator.userAgent.indexOf('Opera') >= 0 ||
					navigator.userAgent.indexOf('Safari') >= 0 ||
					navigator.userAgent.indexOf('Chrome') >= 0 ||
					navigator.userAgent.indexOf('WebKit') >= 0){
		 
					if(window.history.length > 1){
						window.history.back(-1);
					}else{
						window.location.href = "/";
					}
				}else{ //未知的浏览器
					window.history.back(-1);
				}
			}
			**/
		}
    </script>
{/block}


